package misp_backend.controller;

import misp_backend.config.AjaxResult;
import misp_backend.service.KitchenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/kitchen")
public class KitchenController {
    @Autowired
    private KitchenService kitchenService;
    @GetMapping("/getPendingTasks")
    public AjaxResult getPendingTasks(){
        return AjaxResult.success(kitchenService.getPendingTasks());
    }
    @GetMapping("/updateStatus")
    public AjaxResult updateStatus(@RequestParam Long detailid,@RequestParam int newstatus){
        return AjaxResult.success(kitchenService.updateStatus(detailid, newstatus));
    }
}
